home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60src.lha / Vim / vim60 / src / testdir / test8.in < prev    next >
Encoding:
Text File  |  2001-01-23  |  797 b   |  25 lines

  1. Test for BufWritePre autocommand that deletes or unloads the buffer.
  2.  
  3. STARTTEST
  4. :so small.vim
  5. :au BufWritePre Xxx1 bunload
  6. :au BufWritePre Xxx2 bwipe
  7. /^start of
  8. A1:.,/end of/w! Xxx1  " write test file Xxx1
  9. $r2:.,/end of/w! Xxx2   " write test file Xxx2
  10. :e! Xxx2                " edit Xxx2
  11. :bdel test8.in        " delete this file from the buffer list
  12. :e Xxx1                 " edit Xxx1
  13. :w                      " write it, will unload it and give an error msg
  14. :w! test.out            " Write contents of this file
  15. :e! Xxx2                " start editing Xxx2
  16. :bwipe test.out         " remove test.out from the buffer list
  17. :w                      " write it, will delete the buffer and give an error msg
  18. :w >>test.out           " Append contents of this file
  19. :qa!
  20. ENDTEST
  21.  
  22. start of Xxx
  23.     test
  24. end of Xxx
  25.